package cn.lg.soar.system.feign;


import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.system.api.model.DictItemVo;
import cn.lg.soar.system.api.service.IDictApi;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * 字典接口
 * @author luguoxiang
 * @date 2021-08-11
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ConditionalOnMissingClass("cn.lg.soar.system.biz.modules.general.client.DictApiClient")
@ApiClient
@FeignClient(name="system", path= "client/dict", contextId = "DictApiFeign")
public interface DictApiFeign extends IDictApi {

    @GetMapping("listByType")
    @Override
    List<DictItemVo> listByType(@RequestParam("type") String type);

    @GetMapping("listBatch")
    @Override
    Map<String, List<DictItemVo>> listBatch(@RequestParam("types") Collection<String> types);

    @GetMapping("getDict")
    @Override
    DictItemVo getDict(@RequestParam("type") String type, @RequestParam("value") Integer value);

    @GetMapping("getLabel")
    @Override
    String getLabel(@RequestParam("type") String type, @RequestParam("value") Integer value);
    
}
